import request from '@/utils/request'

// 查询information列表
export function listInformation(query) {
  return request({
    url: '/information/information/list',
    method: 'get',
    params: query
  })
}

// 用户头像上传
export function uploadPicture(data) {
  return request({
    url: '/information/information/picture',
    method: 'post',
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
    data: data
  })
}

// 查询information详细
export function getInformation(informationId) {
  return request({
    url: '/information/information/' + informationId,
    method: 'get'
  })
}

export function getInformationByIsbn(bookIsbn) {
  return request({
    url: '/information/information//by-isbn/' + bookIsbn,
    method: 'get'
  })
}

export function getInformationByISBN(ISBN) {
  return request({
    url: '/information/information/by-isbn/' + ISBN,
    method: 'get',
  })
}


// 新增information
export function addInformation(data) {
  return request({
    url: '/information/information',
    method: 'post',
    data: data
  })
}

// 修改information
export function updateInformation(data) {
  return request({
    url: '/information/information',
    method: 'put',
    data: data
  })
}

// 删除information
export function delInformation(informationId) {
  return request({
    url: '/information/information/' + informationId,
    method: 'delete'
  })
}
